package com.atguigu.day03

//柯里化和闭包
object Test02 {
//抽象控制 自定义while函数
  def main(args: Array[String]): Unit = {
    var i: Int = 1
    myWhile{i <= 10} {
      println(i)
      i += 1
  }

  }

  def myWhile(condition: => Boolean)(op: => Unit): Unit = {

    if (condition) {
      op
      myWhile(condition)(op)
    }
  }
}
